<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../../common/meta.jsp"%>

		<script type="text/javascript">
$(function() { 
	$("#fullScreen").click(function() {
		fullScreen.FullScreen("resultDiv");
	});

	$(".deleteAffair").click(function() {

		var affairID = $(this).attr("val");
		var url = "${path}/routine/daily/index/del/" + affairID;
		art.dialog( {
			lock : true,
			content : '确定要删除吗?',
			ok : function() {
				art.dialog( {
					id : "loading",
					lock : true,
					drag : false,
					resize : false,
					title : "正在删除..."
				});
				$.post(url, null, function(result) {
					art.dialog( {
						id : 'loading'
					}).close();//关闭等待框
						if (result == "true") {
							art.dialog( {
								icon : "succeed",
								content : "删除成功!",
								lock : true,
								ok : function() {
									location.reload();
								}
							});
						} else {
							art.dialog( {
								icon : "error",
								content : "删除失败!",
								lock : true,
								ok : true
							});
						}

					});

				return true;
			},
			cancelVal : '关闭',
			cancel : true
		//为true等价于function(){}
				});

	});

	$(".finishAffair").click(function() {
		var affairID = $(this).attr("val");
		art.dialog( {
			lock : true,
			content : '确定?',
			ok : function() {
				art.dialog( {
					id : "loading",
					lock : true,
					drag : false,
					resize : false,
					title : "正在提交..."
				});
				$.ajax( {
					url : "${path}/routine/daily/index/finish/" + affairID,
					type : 'POST',
					timeout : 1000,
					error : function() {
						art.dialog( {
							id : 'loading'
						}).close();//关闭等待框 
					art.dialog( {
						icon : "error",
						content : "错误!请联系管理员",
						lock : true,
						ok : true
					});
				},
				success : function(result) {
					art.dialog( {
						id : 'loading'
					}).close();//关闭等待框 
					if (result == "true") {
						$("#tr_" + affairID + " .statusName").html("处理完成");
						$(".finish_" + affairID).hide();
						art.dialog( {
							icon : "succeed",
							content : "已完成",
							lock : true,
							ok : true
						});
					} else {
						art.dialog( {
							icon : "error",
							content : "失败!",
							lock : true,
							ok : true
						});
					}
				}
				});
				return true;

			},
			cancelVal : '关闭',
			cancel : true
		});

	});
});
</script>
		<style type="text/css">
.title {
	width: 200px;
	white-space: nowrap;
	word-break: keep-all;
	overflow: hidden;
	text-overflow: ellipsis;
}
</style>
	</head>
	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>
		
		 <div class="webpart3 contentarea">
                <div class="webpart-head">
                    <div class="webpart-head-item">
                        日常事务
                        <div class="tools-btn"> 
                            <a href="${path}/routine/daily/index/add"><span>
                                <img src="${path}/statics/images/add2.gif" style="margin-right: 4px;" />新建</span></a>
						<%--&nbsp;&nbsp;<a href="javascript:void(0);" id="fullScreen"><span><img src="${path}/statics/images/qp.gif" style="margin-right: 4px; margin-bottom: -3px;" />全屏</span></a>--%>
					</div>
                    </div>
                </div>
                <div class="webpart-main" id="resultDiv" >
                    <div class="webpart-main-item" style="padding-top: 12px;">
                        <div class="search">
                            <!----------- 查询信息 ------------------>
				<form method="get">
                            <table cellpadding="0" cellspacing="0" >
                                <tr>
                                    <th>
                                        事务标题：
                                    </th>
                                    <td>
                                        <input type="text" name="affairitem" id="affairitem"
										class="input-txt" value="${affairitem}">
                                    </td>
                                    <th>
                                        事务内容：
                                    </th>
                                    <td>
                                        <input type="text" name="affaircontent" id="affaircontent"
										class="input-txt" value="${affaircontent}">
                                    </td>
                                    <th>
                                        事务类型：
                                    </th>
                                    <td>
                                       <sfa:dic showType="select" kindNo="AFFAIRTYPE"
										code="${affairType}" def="ALL:全部;" attr="class='input-txt'"
										name="affairType" id="affairtype"></sfa:dic>
                                    </td>
                                    <td rowspan="2"> 
                                        <input type="submit" class="linkbtn2" value="查询" /><br/>
									<input type="button" class="linkbtn2" value="清空" onclick="location.href='${path}/routine/daily/index/dailylist';" />
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        开始日期：
                                    </th>
                                    <td>
                                        <input id="createdatebegin" name="createdatebegin" type="text"
										onClick="WdatePicker()" class="Wdate input-txt" readOnly="true"
										value="${createdatebegin}" />
                                    </td>
                                    <th>
                                        结束日期：
                                    </th>
                                    <td>
                                        <input id="createdateend" name="createdateend" type="text"
										onClick="WdatePicker()" class="Wdate input-txt" readOnly="true"
										value="${createdateend}" />
                                    </td>
                                    <th>
                                        事务状态：
                                    </th>
                                    <td>
                                       <sfa:dic showType="select" kindNo="AFFAIRSTATUS"
										code="${affairstatus}" def="ALL:全部;" attr="class='input-txt'"
										name="affairstatus" id="affairstatus"></sfa:dic>
                                    </td>
                                </tr>
                            </table>
				</form>
                        </div>
                        <!----------- 数据列表 ------------------>
                        <table cellpadding="0" cellspacing="0" class="dg_borderstyle trStyleTable" style="margin-top: 15px;">
                            <tr>
                            <th>
                            序号
                            </th>
                                <th style="text-align: left;">
                                   &nbsp;&nbsp; 事务标题
                                </th>
                                <th>
                                    事务类型
                                </th>
                                <th>
                                   创建时间
                                </th>
                                <th>
                                    处理状态
                                </th>
                                <th width="90">
                                    操作
                                </th>
                            </tr>
                            	<c:forEach items="${pagination.resultList}" var="affair">
							<tr id="tr_${affair.salePrivateAffairid}">
							<td  align="center">${affair.seq}</td>
								<td  align="left">
									<div title="${affair.affairItem}" style="width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
										<a
										href="${path}/routine/daily/index/detail/${affair.salePrivateAffairid}">${affair.affairItem}
									</a>
									</div>
								</td  align="center">
								<td align="center">
									${affair.affairTypeChnName}
								</td>
								<td  align="center">
									 <fmt:formatDate value="${affair.createdate}"
											pattern="yyyy-MM-dd" />
								</td>
								<td  align="center">
									<span class="statusName">${affair.affairStatusChnName}</span>
								</td>
								<td width="100" align="left">
									<a
										href="${path}/routine/daily/index/edit/${affair.salePrivateAffairid}">编辑
									</a>
									<span class="v_line">| </span>
									<a class="deleteAffair" href="javascript:void(0);"
										val="${affair.salePrivateAffairid}">删除</a>

									<c:if test='${affair.affairstatus=="AFFAIRSTATUS_01"}'>
										<span class="v_line finish_${affair.salePrivateAffairid}">|
										</span>
										<a class="finishAffair finish_${affair.salePrivateAffairid}"
											href="javascript:void(0);"
											val="${affair.salePrivateAffairid}">完成</a>
									</c:if>
								</td>
							</tr>
						</c:forEach> 
                        </table>
                        <!----------- 翻页导航 ------------------>
                       <div class="dg_pagerstyle">
						<div class="pageinfo">
						<c:if test="${not empty pagination.multiPage}">
							   第${pagination.page }页 | 共${pagination.totalPages }页/${pagination.totalRows }条记录
						</c:if>
						</div>
						<div class="pagebtn">
							${pagination.multiPage}
						</div>
					</div>
                    </div>
                </div>
                <div class="webpart-foot">
                    <div class="webpart-foot-item">
                    </div>
                </div>
            </div>
            
             

		<sfa:mainFooter></sfa:mainFooter>

	</body>
</html>



--%>